<template>
  <div class="flex justify-end">
    <el-pagination
      class="right my-4"
      background
      :current-page="num"
      :page-size="size"
      :page-sizes="[10, 15, 20, 50, 100]"
      :total="total"
      layout="total, sizes, prev, pager, next"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  data() {
    return {
      total: 0,
      size: 10,
      num: 1,
    };
  },
  methods: {
    handleSizeChange(val) {
      this.size = val;
      this.num = 1;
      this.$emit("change", this.page);
    },
    handleCurrentChange(val) {
      this.num = val;
      this.$emit("change", this.page);
    },
  },
};
</script>

<style>
</style>